<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core"  prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>商品类别</title>
<link rel="stylesheet" href="css/bootstrap.min.css">
<script type="text/javascript" src="js/jquery-3.2.1.min.js"></script>
</head>
<body>
	<table class="table table-hover">
		<thead>
			<th>类别ID</th>
			<th>类别名字</th>
			<th>父类ID</th>
			<th>创建时间</th>
		</thead>
		<c:forEach items="${cates.pros }" var="cate">
			<tr>
				<td>${cate.cId}</td>
				<td>${cate.cName}</td>
				<td>${cate.pId}</td>
				<td>${cate.timestamp}</td>
			</tr>
		</c:forEach>
	</table>
<nav aria-label="...">
	  <ul class="pagination">
	  	<c:if test="${cates.pageNum!=1}">
	  		<li class="active"><a href="CateController?pageNum=${cates.pageNum-1 }" aria-label="Previous"><span aria-hidden="true">&laquo;</span></a></li>
	  	</c:if>
	  	<c:forEach begin="${cates.startPage }" end="${cates.endPage }" step="1" var="i">
			
			<li class="active"><a href="CateController?pageNum=${i}">${i} <span class="sr-only">(current)</span></a></li>
		
		</c:forEach>
			<c:if test="${cates.pageNum<cates.allPages}">
	  		<li class="active"><a href="CateController?pageNum=${cates.pageNum+1 }" aria-label="Next"><span aria-hidden="true">&raquo;</span></a></li>
	  	</c:if>
	  </ul>
</nav>
<a class="btn btn-default" href="addCateServ" role="button">添加类别</a>
</body>
</html>